package com.tongji.diy.model.furniturePlacementOptimization.assembleComplement
{


	public class SeatNearby extends NearBase
	{
		private var _anginstWall:Boolean = false;
		private var _surroundClass:int = -1;//-1为没有surround特性；
		private var _cost:Number = Infinity;
		private var _accessDistanceList:Vector.<Number> = new Vector.<Number>;
		
		public function SeatNearby(furnitureIndex:int, furnitureClass:int, accessDistanceList:Vector.<Number>, agnistWall:Boolean,length:Number=0, width:Number=0, height:Number=0)
		{
			super(furnitureIndex, furnitureClass, agnistWall,length, width, height);
			_anginstWall = anginstWall;
			_accessDistanceList = accessDistanceList;
			_accessibleBox = buildAccessOBB(x + (_accessDistanceList[3] - _accessDistanceList[2])/ 2,
				y + (-_accessDistanceList[0] + _accessDistanceList[1])/2,
				width + _accessDistanceList[3] + _accessDistanceList[2],
				length + _accessDistanceList[0] + _accessDistanceList[1])
		}
		
		public override function set x(NewX:Number):void
		{
			super.x = NewX;
			_accessibleBox = buildAccessOBB(NewX + (_accessDistanceList[3] - _accessDistanceList[2])/ 2,
				y + (-_accessDistanceList[0] + _accessDistanceList[1])/2,
				width + _accessDistanceList[3] + _accessDistanceList[2],
				length + _accessDistanceList[0] + _accessDistanceList[1])
		}
		
		public override function set y(NewY:Number):void
		{
			super.y = NewY;
			_accessibleBox = buildAccessOBB(x + (_accessDistanceList[3] - _accessDistanceList[2])/ 2,
				NewY + (-_accessDistanceList[0] + _accessDistanceList[1])/2,
				width + _accessDistanceList[3] + _accessDistanceList[2],
				length + _accessDistanceList[0] + _accessDistanceList[1])
		}
		
		public override function set angle(NewAngle:Number):void
		{
			super.angle = NewAngle;
			_accessibleBox = buildAccessOBB(x + (_accessDistanceList[3] - _accessDistanceList[2])/ 2,
				y + (-_accessDistanceList[0] + _accessDistanceList[1])/2,
				width + _accessDistanceList[3] + _accessDistanceList[2],
				length + _accessDistanceList[0] + _accessDistanceList[1]);
		}
		
		public function get accessDistance():Vector.<Number>
		{
			return _accessDistanceList;
		}
		
		
		public function get anginstWall():Boolean
		{
			return _anginstWall;
		}
		
		public function get surroundClass():int
		{
			return _surroundClass;
		}
		
		public function get cost():Number
		{
			return _cost;
		}
	}
}